package com.moleq.models;

import android.R.integer;

import com.moleq.db.DatabaseSchema;

public class ItemSales {
//	CREATE TABLE t_item_sales
//	(is_id INTEGER NOT NULL,
//	is_store_id integer NOT NULL,
//	is_station numeric(3,0) NOT NULL,
//	is_trn_no integer NOT NULL,
//	is_date varchar(8) NOT NULL,
//	is_upc_plu varchar(20) NOT NULL,
//	is_qty integer DEFAULT 0 NOT NULL,
//	is_weight numeric(8,3) DEFAULT 0 NOT NULL,
//	is_wt_unit varchar(2) DEFAULT 'lb' NOT NULL,
//	is_amt numeric(10,3) DEFAULT 0 NOT NULL,
//	PRIMARY KEY (is_id));
	public ItemSales() {
	}

	public ItemSales(int is_id,int is_store_id,int is_station,int is_trn_no,
			String is_date,String is_upc_plu,int is_qty,double is_weight,
			String is_wt_unit,double is_amt) {
		this.is_id = is_id;
		this.is_store_id = is_store_id;
		this.is_station = is_station;
		this.is_trn_no = is_trn_no;
		this.is_date = is_date;
		this.is_upc_plu = is_upc_plu;
		this.is_qty = is_qty;
		this.is_weight = is_weight;
		this.is_wt_unit = is_wt_unit;
		this.is_amt = is_amt;
	}
	
	public ItemSales(int is_store_id,int is_station,int is_trn_no,
			String is_date,String is_upc_plu,int is_qty,double is_weight,
			String is_wt_unit,double is_amt) {
		this.is_store_id = is_store_id;
		this.is_station = is_station;
		this.is_trn_no = is_trn_no;
		this.is_date = is_date;
		this.is_upc_plu = is_upc_plu;
		this.is_qty = is_qty;
		this.is_weight = is_weight;
		this.is_wt_unit = is_wt_unit;
		this.is_amt = is_amt;
	}
	
	private int is_id;
	private int is_store_id;
	private int is_station;
	private int is_trn_no;
	private String is_date;
	private String is_upc_plu;
	private int is_qty;
	private double is_weight;
	private String is_wt_unit;
	private double is_amt;
	
	public int getIs_id() {
		return is_id;
	}

	public void setIs_id(int is_id) {
		this.is_id = is_id;
	}

	public int getIs_store_id() {
		return is_store_id;
	}

	public void setIs_store_id(int is_store_id) {
		this.is_store_id = is_store_id;
	}

	public int getIs_station() {
		return is_station;
	}

	public void setIs_station(int is_station) {
		this.is_station = is_station;
	}

	public int getIs_trn_no() {
		return is_trn_no;
	}

	public void setIs_trn_no(int is_trn_no) {
		this.is_trn_no = is_trn_no;
	}

	public String getIs_date() {
		return is_date;
	}

	public void setIs_date(String is_date) {
		this.is_date = is_date;
	}

	public String getIs_upc_plu() {
		return is_upc_plu;
	}

	public void setIs_upc_plu(String is_upc_plu) {
		this.is_upc_plu = is_upc_plu;
	}

	public int getIs_qty() {
		return is_qty;
	}

	public void setIs_qty(int is_qty) {
		this.is_qty = is_qty;
	}

	public double getIs_weight() {
		return is_weight;
	}

	public void setIs_weight(double is_weight) {
		this.is_weight = is_weight;
	}

	public String getIs_wt_unit() {
		return is_wt_unit;
	}

	public void setIs_wt_unit(String is_wt_unit) {
		this.is_wt_unit = is_wt_unit;
	}

	public double getIs_amt() {
		return is_amt;
	}

	public void setIs_amt(double is_amt) {
		this.is_amt = is_amt;
	}

	public String toMGData(String Action) {
		String Result = Action + "|" + "t_item_sales"
				+ "|(" + null + "," + is_store_id + "," + is_station + ","
				+ is_trn_no + "," + CheckNull(is_date) + "," + CheckNull(is_upc_plu) + ","
				+ is_qty + "," + is_weight + "," + CheckNull(is_wt_unit) + "," + is_amt + ")";
		return Result;
	}

	public String CheckNull(String value) {
		if (value == null) {
			return null;
		} else {
			return "'" + value + "'";
		}
	}
}
